package cn.zxf.note.note.review;

import cn.zxf.note.common.jpa.AbstractEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import lombok.experimental.Accessors;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import jakarta.persistence.Entity;
import jakarta.persistence.Index;
import jakarta.persistence.Table;

import java.util.Date;

/**
 * Created by zengxf on 2019/3/21.
 */
@Entity
@Table(name = "note_review", indexes = { //
        @Index(name = "mi_user_and_date", columnList = "userId"), //
        @Index(name = "mi_user_and_date", columnList = "reviewDate") //
})
@DynamicInsert
@DynamicUpdate
@Data
@Accessors(chain = true)
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
public class NoteReview extends AbstractEntity {

    private Integer userId;
    private Integer noteId;
    private Date reviewDate;    // 计划复习的时间
    private Date reviewedDate;  // 实际复习的时间
    /*** 复习状态 {@link NoteReviewStatusEnum} */
    private Integer status;
    private Integer frequency;

}
